<table id="sample-table-1" class="table table-striped table-bordered table-hover">
												<thead>
												<tr>
											       <th>专业</th>
												<th>删除</th>
											     </tr>
												</thead>

												<tbody>
												<?php
											    foreach($major as $m)
												echo'	
												<tr>
												
												
												<td>'.$m->name.'</td>
												
												<td>
                                               <form id="delete-major-form-'.$m->majorId.'" method ="post" action="'.Yii::app()->createUrl('basicinfo/deletedata').'">
                                               <input type="hidden" name="id" value="'.$m->majorId.'">
                                               <input type="hidden" name="type" value="m">												   
                                               <button type = "button" class="btn btn-xs btn-danger" delete="'.$m->majorId.'">
													<i class="icon-remove-sign bigger-120"></i>
												</button>	
                                               </form>												
												</td>
											    </tr>';
                                               ?>												
											    </tbody>
											
											</table>
											<hr>
<div class="widget-box">
				<div class="widget-header widget-header-small">
					<h5 class="lighter">添加专业</h5>
				</div>

			<div class="widget-body">
				<div class="widget-main">
						<form class="form-horizontal"  method = "post" action="<?php echo Yii::app()->createUrl('basicinfo/adddata'); ?>">
								<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" > 
										  新的专业：
										</label>

										<div class="col-sm-9">
										    <input type="hidden"   name="type" value="major" >
											<input type="text" placeholder="专业名称" class="col-xs-10 col-sm-5 validate[required]" name="name">
											
										</div>
									</div>
									<div class="clearfix form-actions">
										<div class="col-md-offset-3 col-md-9">
											<button type="submit" class="btn btn-info" type="button">
												<i class="icon-ok bigger-110"></i>
											  提交
											</button>

											
										</div>
									</div>
						</form>
				</div>	
		</div>
</div>
<script type="text/javascript">
   jQuery(function($){
	   
	   $("[delete]").on('click',function(){
		    var id = $(this).attr('delete');
			
			bootbox.confirm('删除这个专业之后，这个专业下的所有班级也将会被删除。<br>确定删除吗',function(result){
				if(result){
					
					$('#delete-major-form-'+id).submit();
				}
				
			});
		  
	   })
	   
	   
   })
</script>